<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>float</title>
		<style type="text/css">
			.box{
				width: 50px;
				height: 50px;
				float: left;
			}
		</style>
	</head>
	<body>
		<div class="box" style="background-color: red;"></div>
		<div class="box" style="background-color: orange;"></div>
		<div class="box" style="background-color: yellow;"></div>
		<div class="box" style="background-color: green;"></div>
		<div class="box" style="background-color: indigo;"></div>
		<div class="box" style="background-color: blue;"></div>
		<div class="box" style="background-color: purple;"></div>
		<div class="box" style="background-color: skyblue;"></div>
		<div class="box" style="background-color: olive;"></div>
		<div class="box" style="background-color: azure;"></div>
	</body>
	<script type="text/javascript">
		var boxs = document.querySelectorAll(".box");
		boxs.forEach(function (ele,index) {
			ele.style.height=(index+1)*ele.offsetHeight+"px";
		})
	</script>
</html>
